package com.ciko.code.http.Req;


import com.ciko.code.constant.Api;
import com.ciko.code.http.BaseRequest;
import com.ciko.code.http.Res.QryBooksByNameOrAuthurRes;
import com.ciko.code.utils.LogUtils;
import com.mywork.WorkUIKit;

/**
 * Created by ciko on 2015/11/29.
 */
public class QryBooksByNameOrAuthurReq extends BaseRequest {

    public QryBooksByNameOrAuthurReq(String bookNameOrAuthor , Integer pageNum , Integer length ) {
        init();

        put("bookNameOrAuthor ", bookNameOrAuthor);
        put("pageNum ", pageNum );
        put("length ", length );

        putCid(pageNum + "" + length);
    }

    protected void init(){
        put("account" , WorkUIKit.getUser().getAccount());
        put("timeStamp",getTimeStamp());
        putClientType();
        putAccountType();
    }

    protected void putCid(String paramString) {
        LogUtils.e(WorkUIKit.getUser().getAccount() + getAccountType() + getClientType() + getTimeStamp() + getEnterpriseId() + paramString);
        put("cid", cid(WorkUIKit.getUser().getAccount() + getAccountType() + getClientType() + getTimeStamp() + paramString));
    }

    @Override
    public String getUrl() {
        return Api.qryBooksByNameOrAuthur;
    }

    @Override
    public Class<?> getResponseClazz() {
        return QryBooksByNameOrAuthurRes.class;
    }
}
